<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page pageEncoding="utf-8" contentType="text/html;charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="apliPath" value="${pageContext.request.contextPath}/"
	scope="application" />
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cold Water</title>
<link href="${apliPath}static/css/default.css" rel="stylesheet"
	type="text/css" />
<link rel="stylesheet" type="text/css"
	href="${apliPath}static/js/themes/metro-solidBlue/easyui.css" />
<link rel="stylesheet" type="text/css"
	href="${apliPath}static/js/themes/icon.css" />
<link rel="shortcut icon" type="image/x-icon"
	href="${apliPath}static/images/rihanna.ico" media="screen" />
<link rel="icon" href="${apliPath}static/images/rihanna.ico"
	type="image/x-icon" />
<link rel="bookmark" href="${apliPath}static/images/rihanna.ico"
	type="image/x-icon" />
<script type="text/javascript" src="${apliPath}static/js/md5.js"></script>
<script type="text/javascript"
	src="${apliPath}static/js/cryptoJS/core-min.js"></script>
<script type="text/javascript"
	src="${apliPath}static/js/cryptoJS/aes.js"></script>
<script type="text/javascript"
	src="${apliPath}static/js/cryptoJS/mode-ecb.js"></script>
<script type="text/javascript"
	src="${apliPath}static/js/jquery-1.10.2.js"></script>
<script type="text/javascript"
	src="${apliPath}static/js/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="${apliPath}static/js/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src='${apliPath}static/js/init.js'>
	
</script>

<script type="text/javascript">
	$(function() {
		getTime();
		window.setInterval(getTime, 1000);

		$('#editpass').click(function() {
			$('#w').window('open');
		});
		$.extend($.fn.validatebox.defaults.rules, {
			equals : {
				validator : function(value, param) {
					return value == $(param[0]).val();
				},
				message : '两次密码不一样.'
			}
		});
		$('#loginOut').click(function() {
			$.messager.confirm('系统提示', '您确定要退出本次登录吗?', function(r) {
				if (r) {
					$.get("${apliPath}manager/logout", function(data) {
						window.location.href = "${apliPath}login.html";
					});

				}
			});

		});

	});

	function getTime() {
		var date = new Date();
		var y = date.getFullYear();
		var m = date.getMonth() + 1;
		var d = date.getDate();
		var h = date.getHours();
		var i = date.getMinutes();
		var s = date.getSeconds();
		$("#sysTime").html(
				y + "年" + (m > 9 ? m : ("0" + m)) + "月"
						+ (d > 9 ? d : ("0" + d)) + "日 "
						+ (h > 9 ? h : ("0" + h)) + ":"
						+ (i > 9 ? i : ("0" + i)) + ":"
						+ (s > 9 ? s : ("0" + s)));
	}
	//直接使用了在div中的输入框置空的方式

	function modifyPass() {
		if (document.getElementById("txtNewPass").value == document
				.getElementById("txtRePass").value) {
			$.post("${apliPath}manager/modifyPass?newPass="
					+ Encrypt(document.getElementById("txtNewPass").value,
							"proudToLoveAdios"), function(data) {
				$.get("${apliPath}manager/logout", function(data) {
					window.location.href = "${apliPath}login.html";
				});
			});
		}
	}
	function Encrypt(word, key) {
		var secreKey = CryptoJS.enc.Utf8.parse(key);
		var srcs = CryptoJS.enc.Utf8.parse(word);
		var encrypted = CryptoJS.AES.encrypt(srcs, secreKey, {
			mode : CryptoJS.mode.ECB,
			padding : CryptoJS.pad.Pkcs7
		});
		return encrypted.toString();
	}
	function Decrypt(word, key) {
		var secreKey = CryptoJS.enc.Utf8.parse(key);
		var decrypt = CryptoJS.AES.decrypt(word, secreKey, {
			mode : CryptoJS.mode.ECB,
			padding : CryptoJS.pad.Pkcs7
		});
		return CryptoJS.enc.Utf8.stringify(decrypt).toString();
	}
</script>
<style>
#css3menu li {
	float: left;
	list-style-type: none;
}

#css3menu li a {
	color: #fff;
	padding-right: 20px;
}

#css3menu li a.active {
	color: yellow;
}
</style>
</head>
<body class="easyui-layout" style="overflow-y: hidden" scroll="no">
	<div region="north" split="false"
		style="overflow: hidden; height: 35px; background: url(static/images/layout-browser-hd-bg.jpg) #7f99be repeat-x center 50%; line-height: 30px; color: #404040; font-family: Verdana, 微软雅黑, 黑体">
		<span style="float: left; padding-left: 20px;" class="head">当前登录用户：<font
			style="color:green">${sessionScope.sessionUser.name}</font> <a
			href="#" id="editpass" style="text-decoration: none;color: #404040;">修改密码</a>
			<a href="#" style="text-decoration: none;color: #404040;"
			id="loginOut">安全退出</a>
		</span> <span style="padding-right: 20px; font-size: 16px; float: right;"><img
			src="${apliPath}static/images/rihanna.ico" width="20" height="20"
			align="absmiddle" /> <font size="12">欢迎登录alldios系统 </font></span>
		<ul id="css3menu"
			style="padding: 0px; margin: 0px; list-type: none; float: left; margin-left: 40px;">
			<li><a class="active" name="basic" href="javascript:;">系统时间</a>
			</li>
			<li><a name="point" href="javascript:;"><span
					style="color:#358627" id="sysTime"></span> </a></li>
		</ul>
	</div>
	<div region="south" split="false" border="false"
		style="height: 30px; background: #D2E0F2;">
		<div class="footer">By Retire Men</div>
	</div>
	<div region="west" hide="true" split="false" title="导航菜单"
		style="width: 180px;" id="west">
		<div id='nav' class="easyui-accordion" fit="true" border="false">
			<c:choose>
				<c:when test="${not empty menuList}">
					<c:forEach var="parent_menu" items="${sessionScope.menuList }">
						<c:if test="${parent_menu.hasResource == true}">
							<div title="&nbsp;&nbsp;&nbsp;${parent_menu.name}"
								data-options="iconCls:'icon ${parent_menu.icon}'">
								<ul>
									<c:forEach var="child_menu" items="${parent_menu.children}">
										<c:if test="${child_menu.hasResource == true}">
											<li><div>
													<a href="javascript:void(0)" ref="${child_menu.id }"
														rel="${apliPath}${child_menu.url} "> <span
														class="title" title="${child_menu.icon}">&nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;<span
														class="nav">${child_menu.name}</span>
													</a>
												</div></li>
										</c:if>
									</c:forEach>
								</ul>
							</div>
						</c:if>
					</c:forEach>
				</c:when>
				<c:otherwise>
					<h2>
						&nbsp;&nbsp;&nbsp;没有数据，<br /> &nbsp;&nbsp;&nbsp;因为你没有权限
					</h2>
					<h2>
						&nbsp;&nbsp;&nbsp;没有数据，<br /> &nbsp;&nbsp;&nbsp;因为你没有权限
					</h2>
					<h2>
						&nbsp;&nbsp;&nbsp;没有数据，<br /> &nbsp;&nbsp;&nbsp;因为你没有权限
					</h2>
					<h2>
						&nbsp;&nbsp;&nbsp;没有数据，<br /> &nbsp;&nbsp;&nbsp;因为你没有权限
					</h2>
					<h2>
						&nbsp;&nbsp;&nbsp;没有数据，<br /> &nbsp;&nbsp;&nbsp;因为你没有权限
					</h2>
					<h2>
						&nbsp;&nbsp;&nbsp;伤心不，<br /> &nbsp;&nbsp;&nbsp;因为你没有数据
					</h2>
				</c:otherwise>
			</c:choose>
		</div>

	</div>
	<div id="mainPanle" region="center"
		style="background: #eee; overflow-y: hidden">
		<div id="tabs" class="easyui-tabs" fit="true" border="false">
			<div title="首页你好" style="padding: 20px; overflow: hidden;" id="home">
				<iframe scrolling="auto" frameborder="0"
					src="${aplipath}cms/PageOne.jsp" style="width:100%;height:100%;"></iframe>
			</div>
		</div>
	</div>
	<div id="w" class="easyui-window" title="修改密码" collapsible="false"
		minimizable="false" maximizable="false" icon="icon-save" closed="true"
		style="width: 300px; height: 170px; padding: 5px; background: #fafafa;">
		<div class="easyui-layout" fit="true">
			<div region="center" border="false"
				style="padding: 10px; background: #fff; border: 1px solid #ccc;">
				<table cellpadding=3>
					<tr>
						<td>新密码：</td>
						<td><input id="txtNewPass" name="txtNewPass" type="password"
							class="easyui-validatebox" /></td>
					</tr>
					<tr>
						<td>确认密码：</td>
						<td><input id="txtRePass" type="password" name="txtRePass"
							class="easyui-validatebox" validType="equals['#txtNewPass']" />
						</td>
					</tr>
				</table>
			</div>
			<div region="south" border="false"
				style="text-align: right; height: 30px; line-height: 30px;">
				<a id="btnEp" class="easyui-linkbutton" icon="icon-ok"
					href="javascript:void(0)" onclick="modifyPass()"> 确定</a> <a
					class="easyui-linkbutton" icon="icon-cancel"
					href="javascript:void(0)"
					onclick="javascript:$('#w').window('close')">取消</a>
			</div>
		</div>
	</div>
</body>

</html>